package com.hbzhit.common.enums;

import lombok.Getter;

/**
 * 登录Token类型标识枚举类
 * @author DING
 * @version 1.0
 * @date 2019-6-11 09:59:04
 */
@Getter
public enum TokenTypeEnum {
    /**
     * 后台登陆
     */
    SYS("sys", "后台"),

    /**
     * APP登陆
     */
    APP("app", "APP"),

    /**
     * 第三方登陆
     */
    OPEN("open", "第三方");

    private final String value;
    private final String name;

    TokenTypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public static TokenTypeEnum getEnum(String value) {
        for (TokenTypeEnum item : TokenTypeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }
}
